A prefetcher is used in a processor to improve overall processor performance by speculatively fetching data or instructions before the processor requests the data or instructions. The prefetched data or instructions may be stored in a cache memory or in a buffer.
One way to measure the performance of the prefetcher is based on its accuracy and coverage. The accuracy of the prefetcher indicates whether the prefetched data or instructions are ultimately requested by the processor (a higher accuracy indicates a higher number of prefetches that are ultimately requested). The coverage of the prefetcher relates to the percentage of demand requests that are covered by the prefetcher. Coverage may be estimated by the ratio of demand requests hitting on the prefetched data or instructions to the total number of committed demand requests training the prefetcher.
The performance of the processor may be improved (in terms of overall utilization, number of instructions processed per cycle, or other metric) by tuning the prefetcher to improve its accuracy and/or coverage. If the accuracy and/or coverage of the prefetcher are not high enough, this can lead to cache pollution (having cache entries that will not be used) which in turn could adversely affect the processor's performance.
One existing solution for adjusting prefetcher performance tracks prefetched lines in the cache. One problem with this solution is that the size of the tracking mechanism is directly related to the size of the cache. For example, with a tracking mechanism that uses one bit per cache line and a 2 MB level 2 (L2) cache having 32K lines, 32K bits (or 4 KB) are needed to track all the cache lines. By tying the size of the tracking mechanism to the cache, the capacity of the tracking mechanism is fixed, such that the level of accuracy in the tracking metrics is constrained.